package day0731;

import javax.swing.*;

//敌方小飞机类：
public class SmallPlane extends FlyingObject {
    //1.属性

    //2.方法
    public void move(){
        y= y+speed;
    }

    SmallPlane(){
        x=(int)(Math.random()*420);
        y=-20;
        speed=15;
        ImageIcon iconImg=new ImageIcon("images/airplane0.png");
        img=iconImg.getImage();//getImage方法：将ImageIcon转化为Image类型
        imgWidth=iconImg.getIconWidth();
        imgHeight=iconImg.getIconHeight();
    }

}


